// const CosmeticsTypesModule = require('../../modules/base/cosmeticsBrand');
// const cheerio = require('cheerio');

// const util = require('../../utils/util')

// class CosmeticsTypesControllers {
//   /**
//    * 刷新化妆品品牌分类
//    * 
//    */
//   static async refreshCosmeticsType() {

//     let list = await CosmeticsTypesModule.getCosmeticsList()
    
//     if (list.length !== 0) {
//       return
//     }

//     let html = `
//       <div class="items items-show2line J_Items">
//         <div class="items-inner g-clearfix" id="J_NavCommonRowItems_0">
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:20068" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A20068" title="L&#39;OREAL /欧莱雅">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">L'OREAL /欧莱雅</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:3300940" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A3300940" title="PROYA/珀莱雅">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">PROYA/珀莱雅</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:3278173" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A3278173" title="PECHOIN/百雀羚">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">PECHOIN/百雀羚</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:66927" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A66927" title="CHANDO/自然堂">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">CHANDO/自然堂</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:3328525" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A3328525" title="Kans/韩束">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">Kans/韩束</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:20067" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A20067" title="兰蔻">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">兰蔻</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:3284955" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A3284955" title="美肤宝">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">美肤宝</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:3675642" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A3675642" title="WETCODE/水密码">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">WETCODE/水密码</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:20085" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A20085" title="玉兰油">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">玉兰油</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:105076" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A105076" title="OSM/欧诗漫">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">OSM/欧诗漫</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:78888695" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A78888695" title="Hanhoo/韩后">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">Hanhoo/韩后</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:6037878" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A6037878" title="WIS">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">WIS</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:2298030193" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A2298030193" title="A.H.C/爱和纯">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">A.H.C/爱和纯</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:66915" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A66915" title="丸美">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">丸美</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:3319325" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A3319325" title="WETHERM/温碧泉">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">WETHERM/温碧泉</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:20019" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A20019" title="功能">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">功能</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:66117177" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A66117177" title="碧素堂">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">碧素堂</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:104506277" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A104506277" title="One Leaf/一叶子">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">One Leaf/一叶子</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:1221514619" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A1221514619" title="资莱皙">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">资莱皙</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:708308673" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A708308673" title="健美创研">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">健美创研</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:59732" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A59732" title="相宜本草">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">相宜本草</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:3304254" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A3304254" title="COGI/高姿">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">COGI/高姿</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:7066493" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A7066493" title="Cosme Decorte/黛珂">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">Cosme Decorte/黛珂</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:1347966232" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A1347966232" title="SU:M37°/苏秘37°">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">SU:M37°/苏秘37°</span>
                
//             </a>
          
//             <a class="item icon-tag J_Ajax " href="https://s.taobao.com/search?q=%E5%8C%96%E5%A6%86%E5%93%81&amp;imgfile=&amp;commend=all&amp;ssid=s5-e&amp;search_type=item&amp;sourceId=tb.index&amp;spm=a21bo.2017.201856-taobao-item.1&amp;ie=utf8&amp;initiative_id=tbindexz_20170306#" data-url="nav" data-key="ppath" data-value="20000:3317051" data-action="add" trace="navPropertyNew" trace-click="cps:yes_s;ppath:20000%3A3317051" title="一枝春">
                
//                   <span class="icon-btn-check-small"></span>
                
                
//                 <span class="text">一枝春</span>
                
//             </a>
          
//         </div>
//         </div>`

//     let $ = cheerio.load(html)

//     for (let i = 0; i <= $('.text').length - 1; i++) {
//       let cosmeticsBrands = $('.text')[i].parent.attribs.title.split('/')
//       let id = i
//       let zh = null
//       let en = null
//       for (let j = 0; j <= cosmeticsBrands.length - 1; j++) {
//         if (util.hasZh(cosmeticsBrands[j])) {
//           zh = cosmeticsBrands[j]
//         } else {
//           en = cosmeticsBrands[j]
//         }
//       }
//       CosmeticsTypesModule.addCosmeticsType({id, zhName: zh, enName: en})
//     }
//   }
// }

// module.exports = CosmeticsTypesControllers
